package com.wteam.dragon.shop.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * @Author 陈晓辉
 * @Date 2021/3/24 15:15
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class FlashPromotionProduct extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "对应的秒杀互动id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long flashPromotionId;

    @Column(comment = "对应的场次id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long flashPromotionSessionId;

    @IsNotNull
    @Column(comment = "对应的商品id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long productId;

    @Column(comment = "限时购价格")
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 12, decimalLength = 2)
    private BigDecimal flashPromotionPrice;

    @Column(comment = "限时购数量")
    @ColumnType(value = MySqlTypeConstant.INT)
    private Integer flashPromotionCount;

    @Column(comment = "每人限购数量")
    @ColumnType(value = MySqlTypeConstant.INT)
    private Integer flashPromotionLimit;

    @IsNotNull
    @Column(comment = "排序")
    @ColumnType(value = MySqlTypeConstant.INT)
    @DefaultValue("1")
    private Integer sort;
}
